package proxy;

import dao.NewsDao;
import dao.impl.NewsDaoImpl;
import org.apache.log4j.Logger;
import pojo.News;
import service.Buyer;
import service.NewsService;
import service.impl.NewsServiceImpl;
import service.impl.RealBuyer;

/**
 * @version v1.0
 * @Author JieGe
 * @Create 2024-11-30 - 12:19
 */
public class JdkProxyTest {

    private static Logger logger = Logger.getLogger(JdkProxyTest.class);
    public static void main(String [] args) throws Exception {
        NewsServiceImpl service1 = new NewsServiceImpl();
        service1.setNewsDao(new NewsDaoImpl());

        NewsService service = IntermediaryJdkProxyFactory.create(service1);

        int result = service.save(new News());
        logger.debug(result);
    }

}
